﻿<%@ Page Language="C#" MasterPageFile="~/Shared/FormPage.Master" AutoEventWireup="true" CodeBehind="ContractApprovalForFinance.aspx.cs" Inherits="Runda.CMS.Portal.Workspace.ContractApprovalForFinance" Title="财务审批" %>

<%@ Register assembly="RadCalendar.Net2" namespace="Telerik.WebControls" tagprefix="rad" %>
<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Content/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="../Content/global.js" type="text/javascript"></script>    
    <script src="../Content/Grid/map_grid.js" type="text/javascript" ></script>
    <script language="javascript" src="../Content/Detail.js"></script>
    
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" /> 
    <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" /> 
    <link href="../Content/global.css" rel="stylesheet" type="text/css" /> 
    <link href="../Content/Find/find.css" rel="stylesheet" type="text/css" />   
    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CheckComment() {
            if (document.getElementById('<%=txtComment.ClientID %>').value == '') {
                alert('请输入审批意见!');
                document.getElementById('<%=txtComment.ClientID %>').focus();
                return false;
            }
        }

        function LoadContractItem() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }

            if ($('#ctl00_cphFormArea_listContractType').val() == '0') {
                loadArea("__appNavBar_areaAddress1", "../ContractManage/ContractItemListSaleView.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            else {
                loadArea("__appNavBar_areaAddress1", "../ContractManage/ContractItemListPutView.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            return false;
        }
        function LoadContractProfit() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }
            if ($('#ctl00_cphFormArea_listContractType').val() == '0') {
                loadArea("__appNavBar_areaAddress2", "../ContractManage/ContractProfitSale.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            else {
                loadArea("__appNavBar_areaAddress2", "../ContractManage/ContractProfitPut.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            return false;
        }

        function LoadDocument() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }
            loadArea("__appNavBar_areaAddress3", "../ContractManage/ContractDocument.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "")
            return false;
        }

        function LoadLeaderComment() {
        
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }

            if (document.getElementById('<%=txtTrackID.ClientID %>').value == '') {
                alert('参数传递有误,请联系管理员!'); return false;
            }
            loadArea("__appNavBar_areaAddress4", "ContractAssign.aspx?TrackID=" + document.getElementById('<%=txtTrackID.ClientID %>').value+'&ContractID='+document.getElementById('<%=txtContractID.ClientID %>').value, "")
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFormArea" runat="server">

 <table class="layout" cellspacing="0" cellpadding="0">
        <colgroup>
            <col width="140">
            <!-- 导航菜单：140px -->
            <col />
        </colgroup>
        <tbody>
            <tr>
                <td class="leftBar">
                       <span class="leftBar" id="appNavBar" defaultarea="__appNavBar_navInfo">
                        <div class="lbItem" tabindex="0" title="主要信息" id="__appNavBar_navInfo" onclick='loadArea("areaForm", "","")'>
                            <img src="/Images/info_16_wihte.gif" align="absmiddle">&nbsp; 主要信息</div> 
                        <div class="lbItem" tabindex="1" title="合同明细" onclick='return LoadContractItem();'>
                            <img src="/Images/Info_16_wihte.gif" align="absmiddle">&nbsp; 合同明细</div>
                        <div class="lbItem" tabindex="1" title="利润预算" onclick='return LoadContractProfit();'>
                            <img src="/Images/Menu/Customer_30_white.gif" align="absmiddle">&nbsp; 利润预算</div>
                        <div class="lbItem" tabindex="3" title="合同文档" onclick='return LoadDocument();'>
                                <img src="/Images/Menu/Customer_21_white.gif" align="absmiddle">&nbsp; 合同文档</div> 
                        <div class="lbItem" tabindex="3" title="领导意见" onclick='return LoadLeaderComment();'>
                                <img src="/Images/Menu/Customer_25_white.gif" align="absmiddle">&nbsp; 领导意见</div> 
                    </span>
                    
                    <script language="javascript">                        function _createIframe() { }</script>
                </td>
                <td id="tdAreas">
                
     <div id="areaForm" class="area">
                
                
    <table class="mnubar" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td width="9">
                    <img hspace="3" src="../Content/Menu/mnu_vSpacer.gif">
                </td>
                <td class="icMenu" nowrap>
                    <asp:LinkButton ID="lnkbtnApprove" runat="server" onclick="lnkbtnApprove_Click" OnClientClick="return CheckComment()"><span class="menu" title="同意"><img class="mnuBtn" src="../Content/Menu/Save_16_blue.gif"><span class="mnuBtn">同意</span></span></asp:LinkButton>
                    <asp:LinkButton ID="lnkbtnReject" runat="server" onclick="lnkbtnReject_Click" OnClientClick="return CheckComment()"><span class="menu" title="拒绝" onclick="window.execScript(this.action);"><img class="mnuBtn" src="../Content/Menu/SaveClose_16_blue.gif"><span class="mnuBtn">拒绝</span></span></asp:LinkButton>                           
                    <img src="../Content/Menu/separator.gif">
                    <span class="menu" title="关闭" onclick="window.close();"><img class="mnuBtn" src="../Content/Menu/Close_16_blue.gif"><span class="mnuBtn">关闭</span></span>
                </td>
            </tr>
        </tbody>
    </table>
    
     <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
     </div>

     
     <table cellspacing="0" cellpadding="0" width="100%">
        <tbody>
            <tr>
                <td valign="top">
                    <div style="display: inline" id="Div1" class="tab">
                   <table style="table-layout: fixed" id="Table1" cellspacing="0" cellpadding="3" width="100%">
                        <colgroup>
                            <col width="90">
                            <col>
                            <tbody>
                                <tr>
                                    <td class="req">
                                        审批意见
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Height="50px"></asp:TextBox>
                                    </td>
                                    </tr>
                              </tbody>
                      </table>
                    </div> 
                </td>
            </tr>
        </tbody>
    </table>   
      
    
     <div style="margin:5px 0 5px 0"></div>
     
     <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>合同基本信息</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap> 
                    </td>
                    <td class="icMenu mnuRight" nowrap> 
                    </td>
                </tr>
            </tbody>
        </table>  
        
     <table cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td valign="top">
                            <div style="display: inline" id="appForm_tab0" class="tab">
                                <asp:HiddenField ID="txtContractID" runat="server" />
                                <asp:HiddenField ID="txtTrackID" runat="server" />
                                <table style="table-layout: fixed" id="Section1" cellspacing="0" cellpadding="3" width="100%">
                                    <colgroup>
                                        <col width="90">
                                        <col>
                                        <col width="90">
                                        <col>
                                        <tbody>
                                            <tr>
                                                <td class="req">
                                                    合同编号
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtContractCode" runat="server" CssClass="input"></asp:TextBox> 
                                                </td>
                                                <td>合同属性</td>
                                                <td>
                                                    <asp:DropDownList ID="listContractAttribute" runat="server" CssClass="selectBox"></asp:DropDownList>
                                                </td>
                                            </tr>
                                             <tr>
                                                <td>
                                                    合同申请日期
                                                </td>
                                                <td><rad:RadDatePicker ID="txtContractApplyDate" Runat="server" Culture="Chinese (People's Republic of China)" Skin="WebBlue" Width="100%">
                                                                    <DateInput Skin="WebBlue"></DateInput>
                                                                        <Calendar Skin="WebBlue"></Calendar>
                                                                    </rad:RadDatePicker></td>
                                                <td>合同类型
                                                </td>
                                                <td>
                                                       <asp:DropDownList ID="listContractType" runat="server" CssClass="selectBox"> 
                                                       </asp:DropDownList>
                                               </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    &nbsp;合同条款</td>
                                                <td colspan="3">
                                                      <asp:TextBox ID="txtContractStatement" runat="server" CssClass="input" 
                                                          Height="47px" TextMode="MultiLine"></asp:TextBox>  
                                                </td>
                                            </tr>
                                             <tr>
                                                <td align="left">
                                                    &nbsp;</td>
                                                <td colspan="3">
                                                    当合同总金额达到<rad:RadNumericTextBox ID="radtxtReachTo" runat="server"></rad:RadNumericTextBox>的时候，返还利率<rad:RadNumericTextBox ID="radtxtRebate" runat="server" Width="50px">
<NumberFormat AllowRounding="True"></NumberFormat>
                                                    </rad:RadNumericTextBox>
                                                </td>
                                            </tr>
                                        </tbody>
                                </table>
                            </div> 
                        </td>
                    </tr>
                </tbody>
            </table>
            
     <div style="margin:5px 0 5px 0"></div>               
              
      <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>审批流程列表</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap> 
                    </td>
                    <td class="icMenu mnuRight" nowrap> 
                    </td>
                </tr>
            </tbody>
        </table>  
         
      <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid"></div>
        
       <asp:Repeater ID="RepeaterApprove" runat="server">
                 <HeaderTemplate>
                    <table id="grid" class="grid" cellspacing="0" cellpadding="0">
            <tbody>
                <tr class="header">
                    <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">审批人</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td>
                      <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">审批时间</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td>
                     <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">状态</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td> 
                    <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">意见</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td>
                </tr>
                 </HeaderTemplate>
                 <ItemTemplate>
                  <tr class="data">
                    <td><%#Eval("CheckName")%></td> 
                    <td><%#Eval("CheckDate")%></td>
                    <td><%#GetStatusText(Convert.ToInt32(Eval("CheckStatus")))%></td> 
                    <td><%#Eval("Comment")%></td>
                </tr>
                 </ItemTemplate>
                 <FooterTemplate>
                    </tbody>
                </table>  
                 </FooterTemplate>
             </asp:Repeater>
             
       <div style="margin:5px 0 5px 0"></div>
               
</div> 
        </td>
            </tr>
            <tr>
                <td class="statusBar" colspan="2">
                </td>
            </tr>
        </tbody>
    </table>   
</asp:Content>
